/**
 * partnerSoapSforceComWrapper recreates the operation methods
 * generated in the partnerSoapSforceCom class using parameters and
 * return values based on native Salesforce types.
 *
 * @author  Marty Y. Chang
 * @version alpha
 */
public class soapWShelloworldWrapper{
    
    private static partnerSoapSforceCom.Soap stub;
    private static soapWShelloworld.WSHelloWorld HW;
    private static partnerSoapSforceCom.LoginResult loginResult;
    
    private static void configuraStub(String username, String password)
    {
        /*
         * Create a stub instance of the portType that will be used to
         * carryout the desired operation.
         */
        stub = new partnerSoapSforceCom.Soap();
        
        /*
         * Authenticate with the web service by logging into the
         * target Salesforce org.
         */
        loginResult =stub.login(username, password);
        
        /*
         * Update the endpoint to reflect the actual org in which the
         * deletion will be carried out.
         */
        stub.endpoint_x = loginResult.serverUrl;
        
        /*
         * Update the stub to operate within the context of the newly
         * established session by setting the <code>sessionId</code>
         * value in the stub.
         */
        stub.SessionHeader = new partnerSoapSforceCom.SessionHeader_element();
        stub.SessionHeader.sessionId = loginResult.sessionId;
    }
    
    public static String dimeHolaMundo(String username, String password) {
        
       String s;
       
        configuraStub(username, password);
        
        
        HW = new soapWShelloworld.WSHelloWorld();
        HW.SessionHeader=new soapWShelloworld.SessionHeader_element();
        HW.SessionHeader.sessionId = loginResult.sessionId;

        
        /*
         * Perform the actual deletion by calling the method that was
         * automatically generated from the Partner WSDL.
         */
        s =HW.sayHello('cosa');        
        return s;
    }
}